#!/bin/bash


docker stop $(docker ps -a -f "ancestor=jindujiangongwebapi" -q)
docker rm $(docker ps -a -f "ancestor=jindujiangongwebapi" -q)
docker rmi  jindujiangongwebapi --force


DIR="/root/JinDuJianGong"

if [ -d "$DIR" ]; then
    cd JinDuJianGong
    git pull
else
    git  clone https://gitee.com/m694548114/JinDuJianGong.git
fi
cd /root/JinDuJianGong/NanjingbeiRailwayStation
docker build -f  ./NanjingbeiRailwayStation.WebApi/Dockerfile . -t jindujiangongwebapi
cd /root/JinDuJianGong/Doc/docker-compose-files

docker compose   -f docker-compose-webapi.yml -p JinDuJianGong  down 
docker compose   -f docker-compose-webapi.yml -p JinDuJianGong  up -d